package com.zhangdi.mgsync.core.common;

import com.mongodb.client.model.Aggregates;
import com.mongodb.client.model.Filters;
import org.bson.conversions.Bson;

import java.util.Arrays;
import java.util.List;

import static java.util.Collections.singletonList;

/**
 * Created by zhangdi on 2020/08/11 16:58:55.
 */
public class MgSyncConst {
    public final static String CACHE_NAME = "mg-tokenCache";
    public final static String KEY = "mg-token.";
    public final static String KEY_ERROR = "mg-token-error.";
    public final static List<Bson> PIPELINE = singletonList(Aggregates.match(
            Filters.in("operationType", Arrays.asList("insert", "replace", "update", "delete"))));
    
    public final static String MG_KEY_ID = "_id";
    public final static String MG_KEY_ID_0 = "id";
    public final static String MG_KEY_COLL = "coll";
    public final static String MG_KEY_OP = "op";
    public final static String MG_KEY_DATA = "data";
}
